Optimal. Leaf size=116 \[ \frac {5}{8} a^3 (4 A+3 B) x+\frac {a^3 (4 A+3 B) \sin (c+d x)}{d}+\frac {3 a^3 (4 A+3 B) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {B (a+a \cos (c+d x))^3 \sin (c+d x)}{4 d}-\frac {a^3 (4 A+3 B) \sin ^3(c+d x)}{12 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 116, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 6, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {2830, 2724,
2717, 2715, 8, 2713} \begin {gather*} -\frac {a^3 (4 A+3 B) \sin ^3(c+d x)}{12 d}+\frac {a^3 (4 A+3 B) \sin (c+d x)}{d}+\frac {3 a^3 (4 A+3 B) \sin (c+d x) \cos (c+d x)}{8 d}+\frac {5}{8} a^3 x (4 A+3 B)+\frac {B \sin (c+d x) (a \cos (c+d x)+a)^3}{4 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2713
Rule 2715
Rule 2717
Rule 2724
Rule 2830
Rubi steps
\begin {align*} \int (a+a \cos (c+d x))^3 (A+B \cos (c+d x)) \, dx &=\frac {B (a+a \cos (c+d x))^3 \sin (c+d x)}{4 d}+\frac {1}{4} (4 A+3 B) \int (a+a \cos (c+d x))^3 \, dx\\ &=\frac {B (a+a \cos (c+d x))^3 \sin (c+d x)}{4 d}+\frac {1}{4} (4 A+3 B) \int \left (a^3+3 a^3 \cos (c+d x)+3 a^3 \cos ^2(c+d x)+a^3 \cos ^3(c+d x)\right ) \, dx\\ &=\frac {1}{4} a^3 (4 A+3 B) x+\frac {B (a+a \cos (c+d x))^3 \sin (c+d x)}{4 d}+\frac {1}{4} \left (a^3 (4 A+3 B)\right ) \int \cos ^3(c+d x) \, dx+\frac {1}{4} \left (3 a^3 (4 A+3 B)\right ) \int \cos (c+d x) \, dx+\frac {1}{4} \left (3 a^3 (4 A+3 B)\right ) \int \cos ^2(c+d x) \, dx\\ &=\frac {1}{4} a^3 (4 A+3 B) x+\frac {3 a^3 (4 A+3 B) \sin (c+d x)}{4 d}+\frac {3 a^3 (4 A+3 B) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {B (a+a \cos (c+d x))^3 \sin (c+d x)}{4 d}+\frac {1}{8} \left (3 a^3 (4 A+3 B)\right ) \int 1 \, dx-\frac {\left (a^3 (4 A+3 B)\right ) \text {Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{4 d}\\ &=\frac {5}{8} a^3 (4 A+3 B) x+\frac {a^3 (4 A+3 B) \sin (c+d x)}{d}+\frac {3 a^3 (4 A+3 B) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {B (a+a \cos (c+d x))^3 \sin (c+d x)}{4 d}-\frac {a^3 (4 A+3 B) \sin ^3(c+d x)}{12 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.34, size = 86, normalized size = 0.74 \begin {gather*} \frac {a^3 (240 A d x+180 B d x+24 (15 A+13 B) \sin (c+d x)+24 (3 A+4 B) \sin (2 (c+d x))+8 A \sin (3 (c+d x))+24 B \sin (3 (c+d x))+3 B \sin (4 (c+d x)))}{96 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.13, size = 176, normalized size = 1.52
method | result | size |
risch | \(\frac {5 a^{3} x A}{2}+\frac {15 a^{3} B x}{8}+\frac {15 a^{3} A \sin \left (d x +c \right )}{4 d}+\frac {13 a^{3} B \sin \left (d x +c \right )}{4 d}+\frac {\sin \left (4 d x +4 c \right ) a^{3} B}{32 d}+\frac {\sin \left (3 d x +3 c \right ) A \,a^{3}}{12 d}+\frac {\sin \left (3 d x +3 c \right ) a^{3} B}{4 d}+\frac {3 \sin \left (2 d x +2 c \right ) A \,a^{3}}{4 d}+\frac {\sin \left (2 d x +2 c \right ) a^{3} B}{d}\) | \(135\) |
derivativedivides | \(\frac {a^{3} B \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {A \,a^{3} \left (\cos ^{2}\left (d x +c \right )+2\right ) \sin \left (d x +c \right )}{3}+a^{3} B \left (\cos ^{2}\left (d x +c \right )+2\right ) \sin \left (d x +c \right )+3 A \,a^{3} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+3 a^{3} B \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+3 A \,a^{3} \sin \left (d x +c \right )+a^{3} B \sin \left (d x +c \right )+A \,a^{3} \left (d x +c \right )}{d}\) | \(176\) |
default | \(\frac {a^{3} B \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {A \,a^{3} \left (\cos ^{2}\left (d x +c \right )+2\right ) \sin \left (d x +c \right )}{3}+a^{3} B \left (\cos ^{2}\left (d x +c \right )+2\right ) \sin \left (d x +c \right )+3 A \,a^{3} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+3 a^{3} B \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+3 A \,a^{3} \sin \left (d x +c \right )+a^{3} B \sin \left (d x +c \right )+A \,a^{3} \left (d x +c \right )}{d}\) | \(176\) |
norman | \(\frac {\frac {5 a^{3} \left (4 A +3 B \right ) x}{8}+\frac {73 a^{3} \left (4 A +3 B \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}+\frac {55 a^{3} \left (4 A +3 B \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}+\frac {5 a^{3} \left (4 A +3 B \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {5 a^{3} \left (4 A +3 B \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}+\frac {15 a^{3} \left (4 A +3 B \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4}+\frac {5 a^{3} \left (4 A +3 B \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}+\frac {5 a^{3} \left (4 A +3 B \right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8}+\frac {a^{3} \left (44 A +49 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}\) | \(229\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 167, normalized size = 1.44 \begin {gather*} -\frac {32 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} A a^{3} - 72 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a^{3} - 96 \, {\left (d x + c\right )} A a^{3} + 96 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B a^{3} - 3 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} B a^{3} - 72 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B a^{3} - 288 \, A a^{3} \sin \left (d x + c\right ) - 96 \, B a^{3} \sin \left (d x + c\right )}{96 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 90, normalized size = 0.78 \begin {gather*} \frac {15 \, {\left (4 \, A + 3 \, B\right )} a^{3} d x + {\left (6 \, B a^{3} \cos \left (d x + c\right )^{3} + 8 \, {\left (A + 3 \, B\right )} a^{3} \cos \left (d x + c\right )^{2} + 9 \, {\left (4 \, A + 5 \, B\right )} a^{3} \cos \left (d x + c\right ) + 8 \, {\left (11 \, A + 9 \, B\right )} a^{3}\right )} \sin \left (d x + c\right )}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 371 vs.
\(2 (107) = 214\).
time = 0.22, size = 371, normalized size = 3.20 \begin {gather*} \begin {cases} \frac {3 A a^{3} x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {3 A a^{3} x \cos ^{2}{\left (c + d x \right )}}{2} + A a^{3} x + \frac {2 A a^{3} \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {A a^{3} \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac {3 A a^{3} \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} + \frac {3 A a^{3} \sin {\left (c + d x \right )}}{d} + \frac {3 B a^{3} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 B a^{3} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 B a^{3} x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {3 B a^{3} x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {3 B a^{3} x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {3 B a^{3} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {2 B a^{3} \sin ^{3}{\left (c + d x \right )}}{d} + \frac {5 B a^{3} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} + \frac {3 B a^{3} \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac {3 B a^{3} \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} + \frac {B a^{3} \sin {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (A + B \cos {\left (c \right )}\right ) \left (a \cos {\left (c \right )} + a\right )^{3} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.49, size = 112, normalized size = 0.97 \begin {gather*} \frac {B a^{3} \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} + \frac {5}{8} \, {\left (4 \, A a^{3} + 3 \, B a^{3}\right )} x + \frac {{\left (A a^{3} + 3 \, B a^{3}\right )} \sin \left (3 \, d x + 3 \, c\right )}{12 \, d} + \frac {{\left (3 \, A a^{3} + 4 \, B a^{3}\right )} \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} + \frac {{\left (15 \, A a^{3} + 13 \, B a^{3}\right )} \sin \left (d x + c\right )}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.27, size = 134, normalized size = 1.16 \begin {gather*} \frac {5\,A\,a^3\,x}{2}+\frac {15\,B\,a^3\,x}{8}+\frac {15\,A\,a^3\,\sin \left (c+d\,x\right )}{4\,d}+\frac {13\,B\,a^3\,\sin \left (c+d\,x\right )}{4\,d}+\frac {3\,A\,a^3\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {A\,a^3\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {B\,a^3\,\sin \left (2\,c+2\,d\,x\right )}{d}+\frac {B\,a^3\,\sin \left (3\,c+3\,d\,x\right )}{4\,d}+\frac {B\,a^3\,\sin \left (4\,c+4\,d\,x\right )}{32\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________